/*
    <one line to give the program's name and a brief idea of what it does.>
    Copyright (C) <year>  <name of author>

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License along
    with this program; if not, write to the Free Software Foundation, Inc.,
    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

*/

#ifndef SCENE_SHAPE_H
#define SCENE_SHAPE_H

#include "scenemanager/scene/subscene.h"
#include "scenemanager/geometry/geometry.h"
#include "scenemanager/material/material.h"
#include "scenemanager/textures/texture.h"

namespace object
{
  class ObjectList;
};
namespace draw{
  class FloatMatrix;
};

#include <iostream>
using namespace std;

namespace scene {

class Shape : public SubScene
{
  public:
    Shape(){m_recursive = false; transformed = false;}
    ~Shape(){;}
    
    inline void setGeometry(Geometry* val){m_geo = val;}
    inline void setMaterial(Material* val){m_mat = val;}
    inline void setTexture(Texture* val){m_tex = val;}
    
    virtual void setTransformation(draw::FloatMatrix *val, object::ObjectList *
ol);
    virtual draw::FloatMatrix * getTransformation(){return m_shapeTransform;}
    inline bool isTransformed(){return transformed;}
    inline void print()
    {
      cout << "Geo:" << m_geo->name().toStdString() << "\n";
      
      if(m_mat != NULL)
        cout << "Mat:" << m_mat->name().toStdString() << "\n";
      else
        cout << "No material...\n";
      
      if(m_tex != NULL)
        cout << "Tex:" << m_tex->name().toStdString() << "\n";
      else
        cout << "No texture...\n";
      
      if(transformed)
        m_shapeTransform->print();
      else
        cout << "No transformation...\n";
      }
      
      Geometry * getGeo(){return m_geo;}
      Material * getMat(){return m_mat;}
      Texture * getTex(){return m_tex;}
   
  private:
    Geometry *m_geo;
    Material *m_mat;
    Texture  *m_tex;
    
    draw::FloatMatrix *m_shapeTransform;
    bool transformed;
    
};

}

#endif // SCENE_SHAPE_H
